package com.hevs.samplewebapp.server.dao;

import java.util.List;

import com.google.appengine.api.datastore.Key;
import com.hevs.samplewebapp.server.entities.MedicalRecord;
import com.hevs.samplewebapp.server.entities.User;

/**
 * Interface for the Data "medical data", to update, remove and get all the medical data.
 * 
 * @author Lionel Rey, Arnaud Durand
 * @date 08.03.12
 */
public interface MedicalRecordDAO {

	// Methods
	
	/**
	 * Get all the medical datas
	 * @return
	 * list of medical data
	 */
	public abstract List<MedicalRecord> getAll();
	
	/**
	 * Method to retrieve 1 medical data by its key
	 * @param key
	 * medical record Key
	 * @return
	 * a medical record
	 */
	public abstract MedicalRecord getMedicalRecord(Key key);

	/**
	 * Create new medical datas
	 * @param medicalRecords
	 * list of medical data to create
	 */
	public abstract void add(List<MedicalRecord> medicalRecords);
	
	/**
	 * Update a medicale data or create a new one
	 * @param medicalRecord
	 * the medical record to update
	 */
	public abstract void update(MedicalRecord medicalRecord);

	/**
	 * Remove a medical data
	 * @param medicalRecord
	 * the medical data to delete
	 */
	public abstract void remove(MedicalRecord medicalRecord);
	
	/**
	 * Methode to retrieve all medical records for a specific user
	 * @param user
	 * owner of the medical data
	 * @return
	 * the list of medical data
	 */
	public abstract List<MedicalRecord> getAll(User user);
	
	
	
}
